package com.athuiju.fenxiaoback.controller;


import com.athuiju.fenxiaoback.entity.HjCareerCare;
import com.athuiju.fenxiaoback.entity.HjEducation;
import com.athuiju.fenxiaoback.entity.HjInvolvedid;
import com.athuiju.fenxiaoback.entity.HjMajor;
import com.athuiju.fenxiaoback.entity.vo.VisitWorkExVo;
import com.athuiju.fenxiaoback.service.*;
import com.athuiju.fenxiaoback.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zs
 * @since 2021-10-11
 */
@Api(description = "<font style='color:red;'><strong>到访</strong></font>",tags = "<font style='color:red;'><strong>到访</strong></font>")
@RestController
@RequestMapping("/fenxiaoback01/hj-visit")
public class HjVisitController {

    @Autowired
    HjVisitService hjVisitService;

    //职业生涯
    @Autowired
    HjCareerCareService hjCareerCareService;

    @ApiOperation(value = "获取职业生涯看重什么列表")
    @GetMapping("hjCareerCaresList")
    public R hjCareerCaresList(){
        List<HjCareerCare> hjCareerCaresList = hjCareerCareService.list(null);
        return R.ok().setData(hjCareerCaresList);
    }



    @Autowired
    HjEducationService educationService;

    @ApiOperation(value = "最高学历列表")
    @GetMapping("educationlist")
    public R educationlist(){
        List<HjEducation> educationList = educationService.list(null);
        return R.ok().setData(educationList);
    }


    @Autowired
    HjInvolvedidService involvedidService;
    @ApiOperation(value = "所属行业列表")
    @GetMapping("involvedidlist")
    public R involvedidlist(){
        List<HjInvolvedid> involvedidList = involvedidService.list(null);
        return R.ok().setData(involvedidList);
    }


    @Autowired
    HjMajorService majorService;
    @ApiOperation(value = "获取所学专业列表")
    @GetMapping("majorlist")
    public R majorlist(){
        List<HjMajor> majorList = majorService.list(null);
        return R.ok().setData(majorList);
    }

    /*
    {
	"advantage": "应聘岗位的优势",
	"beginTime": "2019-05-05 00:00:00",
	"birthday": "2000-05-05 00:00:00",
	"careerAttentionid": 3,
	"careerPlanning": "职业生涯规划",
	"certifier": "证明人姓名以及联系方式",
	"companyName": "公司名称",
	"computerlevelid": 1,
	"eamil": "123456789@qq.com",
	"earliestAvailableTime": "2021-8-8 00:00:00",
	"endTime": "2019-5-5 00:00:00",
	"expectedSalary": "期望薪资",
	"expectedWorkplace": "期望工作地",
	"graduateInstitutions": "毕业院校",
	"graduateTime": "2010-8-8 00:00:00",
	"healthStatus": "健康状况",
	"highestEducation": 2,
	"industryInvolvedid": 2,
	"jobCandidates": 1,
	"jobTitle": "职位名称",
	"majorid": 1,
	"maritalStatus": false,
	"nationality": "民族",
	"nativeAddress": "户籍地址",
	"nativePlace": "籍贯",
	"nowDwellAddress": "现居住地址",
	"phone": "电话",
	"politicsStatus": "政治面貌",
	"relevantcertificate": "相关证书",
	"sex": false,
	"version": 0,
	"visitName": "姓名",
	"xuexinisfind": 1
}
    * */

    @ApiOperation(value = "添加到访")
    @PostMapping("add")
    public R add(@RequestBody VisitWorkExVo visitWorkExVo){

        boolean isSuccess= hjVisitService.saveVisit(visitWorkExVo);

        return R.ok();
    }

}

